import * as ActionType from './actionType'
import Unit from '../../hml'
export const getUrl=(text,data=[],prevData)=>{
    // data.data = [...prevData,...data.data]
    return{
        type:ActionType.URL,
        text:text,
        data:data
    }
}

export const getFn=(text,ajax,dispatch,prevData)=>{
    return{
        type:ActionType.FN,
        text:text,
        ajaxFn:Unit.getApi(ajax).then((res)=>{
            dispatch(getUrl('发送请求',res.data,prevData))
            
        })
    }
}

